package puppy.graph;

import java.util.Enumeration;
import java.util.Hashtable;

public class DeliciousEdge {


	
	
	boolean type =false;  // 0 for url -> tag ; 1 for tag -> url
	
	public DeliciousNode url=null;
	public DeliciousNode tag =null;
	// should be private for good practice
	
	//public Hashtable<String, Short> freq_type= new Hashtable<String,Short>(); 
	private float prob=0f;
	
	public boolean url_to_tag(){
		
		
		if(!type) return true;
		
		else return false;
		
	}
	
	public boolean tag_to_url(){
		
		return type;
	}
	
	
	


	public void setType(boolean type) {
		this.type = type;
	}




	public void setProb(float freq){
		prob=freq;
		
		
	}
	
	public float getProb(){
		//prob=freq;
		return prob;
		
	}
	
/*	public void printFreqType(){
		
		
		Enumeration<String> iter = freq_type.keys();
		System.out.println("Printing edge type freq" + freq_type.size());
		while(iter.hasMoreElements()){
			
			String key = iter.nextElement();
			System.out.println(url.getName()+ "\t+ " + tag.getName() + "\tid:" + "\t"+ key + "\t" + freq_type.get(key));
		}
		
	}*/
	
	/*public int getFreq(String type){
		
		//System.out.println(type + "\t" + freq_type + "\t"+ id + "\t"+ freq_type.get(type));
		if(!freq_type.containsKey(type)) {
			return 0;
		}
		else{
			return  freq_type.get(type);
		}
		
	}*/
	
	/*public int getFreqTotal() {
		
		Enumeration<String> keys = freq_type.keys();
		int freq=0;
		while(keys.hasMoreElements()){
			
			String key =keys.nextElement();
			freq = freq + freq_type.get(key);
			
			
		}
		return freq;
	}*/
	public String toString() { // Always good for debugging
		return "E" ; 
	}

}
